home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-0497 / AMOSLIST / text0149.txt < prev    next >
Encoding:
Text File  |  1998-06-24  |  1.8 KB  |  85 lines

  1.  
  2. >I want to read the date in my computer with amos  without using 'copy date to
  3. >ram'
  4.  
  5. >I did get some answer before but I couldn't get it to work.
  6.  
  7. This is a ready-to-use procedure that was originally on
  8. the Extras disk of Amos1.3: cut,paste and enjoy ;)
  9.  
  10. '----------------------------------
  11. ' How to get TIME and DATE in AMOS
  12. '----------------------------------
  13. '
  14. _DATE$ : Print Param$
  15. _TIME$ : Print Param$
  16. '
  17. Procedure _DATE$
  18.    '
  19.    ' Call DOS DateStamp function
  20.    T$=Space$(12)
  21.    Dreg(1)=Varptr(T$)
  22.    RIEN=Doscall(-192)
  23.    NJ=Leek(Varptr(T$))
  24.    '
  25.    ' Find this year's first day
  26.    A=1978 : JOUR=7
  27.    Do
  28.       BIS=0 : If(A and 3)=0 : BIS=1 : End If
  29.       Exit If NJ-365-BIS<0
  30.       Add JOUR,1+BIS : If JOUR>7 : Add JOUR,-7 : End If
  31.       Add NJ,-365-BIS
  32.       Inc A
  33.    Loop
  34.    '
  35.    ' Find month
  36.    M=1
  37.    Do
  38.       Read N
  39.       Exit If NJ-N<0
  40.       Add NJ,-N : Inc M
  41.    Loop
  42.    Inc NJ
  43.    '
  44.    ' Fabrique la chaine
  45.       J$=Mid$(Str$(NJ),2) : If Len(J$)<2 : J$="0"+J$ : End If
  46.       M$=Mid$(Str$(M),2) : If Len(M$)<2 : M$="0"+M$ : End If
  47.       A$=Mid$(Str$(A),2)
  48.       DATE$=J$+"-"+M$+"-"+A$
  49.    '
  50.    ' Length of each month
  51.    Data 31,28+BIS,31,30,31,30,31,31,30,31,30,31
  52.    '
  53. End Proc[DATE$]
  54. Procedure _TIME$
  55.    '
  56.    ' Call DOS function
  57.    T$=Space$(12)
  58.    Dreg(1)=Varptr(T$)
  59.    RIEN=Doscall(-192)
  60.    MN=Leek(Varptr(T$)+4)
  61.    SEC=Leek(Varptr(T$)+8)
  62.    '
  63.    ' Minutes calculation
  64.    H=MN/60 : H$=Mid$(Str$(H),2) : If Len(H$)<2 : H$="0"+H$ : End If
  65.    M=MN mod 60 : M$=Mid$(Str$(M),2) : If Len(M$)<2 : M$="0"+M$ : End If
  66.    '
  67.    ' Seconds calculation
  68.    S=SEC/50 : S$=Mid$(Str$(S),2) : If Len(S$)<2 : S$="0"+S$ : End If
  69.    '
  70.    ' Final string
  71.    TIME$=H$+":"+M$+":"+S$
  72.    '
  73. End Proc[TIME$]
  74.  
  75.  
  76.  
  77.  
  78.      ________________
  79.   __//______________
  80.   \// abrizio Bazzo   /* fbazzo@quark.it */
  81.  
  82. Where can I fnid a spell chequer for taglines?
  83.  
  84.  
  85.